using UnityEngine;
using UnityEngine.UI;

[RequireComponent(typeof(Button))]
public class exitbuttoncontroller : MonoBehaviour
{
    private void Start()
    {
        var bt = gameObject.GetComponent<Button>();
        bt.onClick.AddListener(() =>
        {
#if UNITY_EDITOR
            UnityEditor.EditorApplication.isPlaying = false;
#else
            Application.Quit();
#endif
        });
    }
   
}
